package nancal.mp.db.mongo.table

import java.io.*
import nbcp.base.db.*
import nbcp.base.comm.*
import nbcp.base.extend.*
import nbcp.base.enums.*
import nbcp.base.utils.*
import nbcp.myoql.db.*
import nbcp.myoql.db.comm.*
import nbcp.myoql.db.enums.*
import nbcp.myoql.db.mongo.*
import nbcp.myoql.db.mongo.base.*
import nbcp.myoql.db.mongo.component.*
import org.slf4j.LoggerFactory
import org.springframework.stereotype.*


@Component("mongo.finance")
@MetaDataGroup(DatabaseEnum.Mongo, "finance")
class FinanceGroup : IDataGroup {
    override fun getEntities(): Set<BaseMetaData<out Any>> = setOf(bankCard, sysMoney)



    val bankCard get() = BankCardEntity();




    val sysMoney get() = SysMoneyEntity();



    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """finance""")
    class BankCardEntity(collectionName: String = "bankCard") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.BankCard>(nancal.mp.db.mongo.entity.BankCard::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val createBy = OpenIdNameMeta("createBy")

        val realname = MongoColumnName("realname")

        val phoneNumber = MongoColumnName("phoneNumber")

        val bankName = MongoColumnName("bankName")

        val bankNumber = MongoColumnName("bankNumber")

        val bname = MongoColumnName("bname")

        val bankZhiName = MongoColumnName("bankZhiName")

        val bankCode = MongoColumnName("bankCode")

        val cardType = MongoColumnName("cardType")

        val flag = MongoColumnName("flag")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """finance""")
    class SysMoneyEntity(collectionName: String = "sysMoney") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.SysMoney>(nancal.mp.db.mongo.entity.SysMoney::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val createBy = OpenIdNameUrlMeta("createBy")

        val money = MongoColumnName("money")

        val balance = MongoColumnName("balance")

        val cashMoney = MongoColumnName("cashMoney")

        val flag = MongoColumnName("flag")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

}

